new Vue({
    el: '#app',
    data() {
        return {
            form: {
                SQLSerialNumber: "P_base_operation_log",
                PaginationNumber: 1,//页数
                RowAmount: 15,//每页数据条数
                Operation_Type:'',
                ID_Name: '',
                Table_Name:'',
                Condition: '',
                ExtensionCondition: '',
            },
            Operation_Type:["平台端操作","客户端操作"],
            total: 0,
            tableData: [],	//表格数据
            Table:[{
                label:'商品分类',
                value:'business_classify',
            },{
                label:'操作员管理',
                value:'base_system_user_info',
            },{
                label:'商品信息',
                value:'business_article_info',
            },{
                label:'积分操作',
                value:'business_member_cash_points',
            },{
                label:'销售价格单',
                value:'business_sales_unitprice',
            },{
                label:'采购价格单',
                value:'business_purchase_unitprice',
            },{
                label:'供应商库存',
                value:'business_supplier_article_stock',
            },{
                label:'积分配置',
                value:'business_points_config',
            },{
                label:'登录',
                value:'base_system_login_log',
            },{
                label:'积分配置(供应商品配置)',
                value:'business_points_detail_config',
            },{
                label:'游客商品',
                value:'business_supplier_article_tourist_config',
            },{
                label:'品牌管理',
                value:'business_brand',
            },{
                label:'商品信息(审核)',
                value:'business_article_log',
            },{
                label:'供应商商品',
                value:'business_supplier_article',
            },{
                label:'微信客户',
                value:'business_member_account_info',
            },{
                label:'用户管理',
                value:'business_member_info',
            },{
                label:'订单管理(收款)',
                value:'business_collection',
            },{
                label:'订单管理',
                value:'business_sales_order',
            },{
                label:'部门管理',
                value:'business_department_info',
            },{
                label:'采购订单',
                value:'business_purchase_order',
            },{
                label:'角色管理',
                value:'base_system_role_info',
            },{
                label:'定制活动',
                value:'business_activity',
            },{
                label:'供应商信息',
                value:'business_supplier_info',
            }]
        }
    },
    computed: {
        Table_Name() {
            return function (str) {
                try {
                    return this.Table.filter(i=>i.value == str)[0].label;
                } catch (error) {
                    return str
                }
                
            }
        },
    },
    mounted() {
        this.getList(this.form);//前端分页
    },
    methods: {
        onSerach() {			//查询方法
            this.form.PaginationNumber = 1;
            this.getList(this.form)
        },
        handleSizeChange(val) {
            this.form.PaginationNumber = 1;
            this.form.RowAmount = val;
            this.getList(this.form)
        },
        handleCurrentChange(val) {
            this.form.PaginationNumber = val;
            this.getList(this.form)
        },
        getList(form) {//换页方法
            const that = this
            let data = deepClone(form);
            data.Condition = window.btoa(unescape(encodeURIComponent("%" + data.ID_Name + "%,%" + data.Operation_Type + "%,%"+data.Table_Name+"%")));
            $.ajax({
                headers: requestHeaders(),
                type: 'POST',
                url: `${BASE_URL2}/generalBusiness/generalPaginationQueryBySQLSerialNumber`,
                data,
                success: function (Result) {
                    that.tableData = Result.Rows;
                    that.total = Result.TotalRows;
                },
                complete: function (XMLHttpRequest) {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json"
            });
        },
    },
})